export default function useItem(){
    let date = new Date(); //获取当前时间
    let Hour = ref(date.getHours())
    let Minute = ref(date.getMinutes())
    let Second =ref(date.getSeconds())
    let hour = ref<number|string>()
    let minute = ref<number|string>()
    let second =ref<number|string>()
    

    // 倒计时
    const {} = useIntervalFn(()=>{
      
         Second.value ++
        if(Second.value<10)  {
            second.value = '0' + Second.value
        }else{
            second.value  = Second.value
        }
        if(Minute.value<10)  {
            minute.value = '0' + Minute.value
        }else{
            minute.value  = Minute.value
        }
        if(Hour.value<10)  {
            hour.value = '0' + Hour.value
        }else{
            hour.value  = Hour.value
        }
        if(Second.value>59 ){
            Second.value = 0
            Minute.value ++
            
        }else if(Minute.value>59 && typeof Hour.value != 'string'){
            Minute.value = 0
            Hour.value ++
        }else if (Hour.value>23){
            Hour.value = 0
        }
    },1000,
    
    );
    
     return {hour,minute,second}
}



